libs/light: make it build without setresuid()
authorManuel Bouyer <bouyer@netbsd.org>
Tue, 26 Jan 2021 22:47:57 +0000 (23:47 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 29 Jan 2021 22:50:08 +0000 (22:50 +0000)
commit9e80a1e37bc3813d02ee7a647201c7153420113e
treee766efe2e497419d5bb941f721659eee1c3fde8d
parent2e07dd6c32948794248ee65ae5237ad9ad4fbfa9
libs/light: make it build without setresuid()

NetBSD doesn't have setresuid(). introcuce libxl__setresuid(),
which on NetBSD assert() that it's never called (it should not be called when
dm restriction is off, and NetBSD doesn't support dm restriction at
this time).
On linux and FreeBSD it just calls setresuid().

Signed-off-by: Manuel Bouyer <bouyer@netbsd.org>
Reviewed-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/libs/light/Makefile
tools/libs/light/libxl_dm.c
tools/libs/light/libxl_internal.h
tools/libs/light/libxl_netbsd.c
tools/libs/light/libxl_setresuid.c [new file with mode: 0644]